<?php
/* SVN FILE: $Id$ */
/**
 * The front page template file
 *
 * This is the standard template for displaying the static front page of the
 * website
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package        CPConstruction
 * @subpackage     Page Templates
 * @copyright      CP Construction (Gwent) Ltd <http://www.cpconstruction.co.uk/> 2012
 * @author         Richard Perry <http: //www.perry-online.me.uk/>
 * @since          Release 0.1.0
 * @version        $Rev$
 * @modifiedby     $LastChangedBy$
 * @lastmodified   $Date$
 *
 * @todo           ToDo List
 *                  -
 */

get_header(); // Load the header.php template. ?>

            <div id="container">
                <div id="content">
                <?php 
                if ( have_posts() ) {
                    /* Start the Loop */
                    while ( have_posts() ) {
                        the_post();
                        get_template_part('partials/content', 'front-page'); 
                    }
                } else {
                    get_template_part('partials/nothing', 'default'); 
                }
                ?>
                    <div id='news'>
                        <h3>Latest News</h3>
                        <?php 
                            $the_query = new WP_Query( 'showposts=5&category_name=news' ); 
                            while ($the_query -> have_posts()) {
                                $the_query -> the_post(); 
                                get_template_part('partials/summary', 'news');
                            }
                        ?>
                    </div><!-- #news -->
                </div><!-- #content -->
            </div><!-- #container -->
            
            <div id="primary" class="widget-area">
                <ul class="xoxo">
                    <?php dynamic_sidebar('front_page_widget_area'); ?>
                </ul>
            </div><!-- #primary .widget-area -->

<?php get_footer(); // Load the footer.php template. ?>